﻿<%@ Page Title="Edit Customer Types" Language="C#" MasterPageFile="~/Pages/admin/adminMaster.Master" AutoEventWireup="true" CodeBehind="EditCustomerTypes.aspx.cs" Inherits="WarehouseWebAPP.Pages.admin.Edit_Entities.EditCustomerTypes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="style1">
    <tr>
        <td>
                            &nbsp;</td>
    </tr>
    <tr>
        <td>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:Label ID="ErrorLabel" runat="server" BackColor="#FFFFCC" 
                        ForeColor="Maroon" Height="24px" 
                        Text="Error: The entity can't be deleted from the following reason: This entity is a FK of other entity." 
                        Visible="False"></asp:Label>
                    <asp:DetailsView ID="CustomerTypeDetailsView" runat="server" AllowPaging="True" 
                AutoGenerateRows="False" CellPadding="4" DataKeyNames="customer_type_num" 
                DataSourceID="CustomerTypeObjectDataSource" ForeColor="#333333" 
                GridLines="None" Height="50px" Width="387px" 
                onitemdeleting="CustomerTypeDetailsView_ItemDeleting">
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <Fields>
                            <asp:BoundField DataField="customer_type_num" HeaderText="customer_type_num" 
                        ReadOnly="True" SortExpression="customer_type_num" Visible="False" />
                            <asp:TemplateField HeaderText="Customer Type" SortExpression="customer_type">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TypeTextBox" runat="server" 
                                Text='<%# Bind("customer_type") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="TypeTextBox" ErrorMessage="*"></asp:RequiredFieldValidator>
                                    <asp:CustomValidator ID="CustomValidator1" runat="server" 
                                ControlToValidate="TypeTextBox" ErrorMessage="Already Exist" 
                                onservervalidate="CustomValidator1_ServerValidate"></asp:CustomValidator>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("customer_type") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="CustomerTypeLabel" runat="server" 
                                Text='<%# Bind("customer_type") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                        </Fields>
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#999999" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    </asp:DetailsView>
                </ContentTemplate>
            </asp:UpdatePanel>
            <asp:ObjectDataSource ID="CustomerTypeObjectDataSource" runat="server" 
                DeleteMethod="CustomerTypeDelete" SelectMethod="CustomerTypeGet" 
                TypeName="WarehouseWebAPP.code.BLL.CustomerTypeBLL" 
                UpdateMethod="CustomerTypeUpdate">
                <UpdateParameters>
                    <asp:Parameter DbType="Guid" Name="customer_type_num" />
                    <asp:Parameter Name="customer_type" Type="String" />
                </UpdateParameters>
            </asp:ObjectDataSource>
        </td>
    </tr>
</table>
</asp:Content>
